import React, { Component } from 'react'
import betterScroll from 'better-scroll'
export default class App extends Component {
    state={
        list:[]
    }
    render() {
        return (
            <div>
                <button onClick={()=>this.getDate()}>click</button>
                <div className="wrapper" style={{height:'100px',background:"yellow",overflow:"hidden"}}>
                <ul className="content">
                    {
                        this.state.list.map((item,i)=>
                            <li key={i}>{item}</li>
                    )
                    }
                    
                </ul>
                </div>
            </div>
        )
    }
    getDate(){
        let list=[1,2,3,3,45,6,7,8,4,3,2]
        this.setState({
            list:list
        },()=>{
            new betterScroll(".wrapper")
        })
        
    }
}
